package com.ego.exception;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * @author Ares
 * @date 2020-11-24
 */
@NoArgsConstructor
@AllArgsConstructor
public enum ExceptionEnum implements IException {

    GOODS_PAGE_ERROR(400,"货物分页查询异常"),
    BRAND_CREATE_FAILED(500, "新增品牌失败"),
    BRAND_NOT_FOUND(404, "品牌查询失败"),
    UPDATE_BRAND_FAILED(500, "品牌更新失败"),
    DELETE_BRAND_EXCEPTION(500, "删除品牌失败"),

    GOODS_SAVE_ERROR(500, "新增商品错误"),
    GOODS_NOT_FOUND(400, "商品未查询到"),
    GOODS_NOT_SALEABLE(400, "商品未上架"),
    GOODS_UPDATE_ERROR(500, "商品更新失败"),
    GOODS_PARSE_EXCEPTION(400,"商品转换异常"),
    DELETE_GOODS_ERROR(500, "删除商品错误"),
    UPDATE_SALEABLE_ERROR(500, "更新商品销售状态错误"),
    STOCK_NOT_ENOUGH(500, "商品库存不足"),

    CATEGORY_NOT_FOUND(204, "分类未查询到"),
    STOCK_NOT_FOUND(204, "库存查询失败"),
    SPU_NOT_FOUND(201, "SPU未查询到"),
    SKU_NOT_FOUND(201, "SKU未查询到"),

    INVALID_FILE_FORMAT(400, "文件格式错误"),
    UPLOAD_IMAGE_EXCEPTION(500, "文件上传异常"),
    INVALID_PARAM(400, "参数错误"),
    USERNAME_OR_PASSWORD_ERROR(400, "账号或密码错误"),
    VERIFY_CODE_NOT_MATCHING(400, "验证码错误"),
    PASSWORD_NOT_MATCHING(400, "密码错误"),
    USER_NOT_EXIST(404, "用户不存在"),
    BAD_KEY_REQUEST(404,"搜索关键字未找到"),

    SPEC_PARAM_NOT_FOUND(204, "规格参数查询失败"),
    NULL_SPEC_PARAM(204,"规格参数为空"),
    UPDATE_SPEC_PARAM_FAILED(500, "商品规格参数更新失败"),
    DELETE_SPEC_PARAM_FAILED(500, "商品规格参数删除失败"),
    SPEC_PARAM_CREATE_FAILED(500, "新增规格参数失败"),
    SPEC_TRANS_ERROR(500,"规格参数转换失败"),
    USER_NOT_LOGIN(401, "用户未登录，请登录"),


    SPEC_GROUP_CREATE_FAILED(500, "新增规格组失败"),
    SPEC_GROUP_NOT_FOUND(204, "规格组查询失败"),
    DELETE_SPEC_GROUP_FAILED(500, "商品规格组删除失败"),
    UPDATE_SPEC_GROUP_FAILED(500, "商品规格组更新失败"),

    RECEIVER_ADDRESS_NOT_FOUND(400, "收获地址不存在"),
    ORDER_NOT_FOUND(400, "订单不存在"),
    ORDER_STATUS_EXCEPTION(500, "订单状态异常"),
    ORDER_PARAMS_EXCEPTION(400,"订单参数异常"),
    ORDER_SUBMIT_EXCEPTION(500,"订单提交异常"),
    CREATE_PAY_URL_ERROR(500, "常见支付链接异常"),
    WX_PAY_SIGN_INVALID(400, "微信支付签名异常"),
    WX_PAY_NOTIFY_PARAM_ERROR(400, "微信支付回调参数异常"),
    CREATE_STATIC_PAGE_ERROR(400,"静态化页面出错"),
    SEND_MSG_EXCEPTION(500,"消息发送异常"),
    USER_EXIST(400,"用户已存在"),
    PHONE_EXIST(400,"电话号码已存在"),
    USER_SAVE_ERROR(500,"用户保存错误"),
    JWT_CREATE_ERROR(500,"创建JWT TOKEN错误"),
    INIT_EXCEPTION(500,"初始化异常"),
    CART_QUERY_EXCEPTION(500,"购物车查询异常"),
    SECKILL_PATH_EXCEPTION(500,"秒杀商品路径异常"),
    SECKILL_EXCEPTION(500,"秒杀异常"),
<<<<<<< HEAD

    FOOT_ADD_EXCEPTION(500,"添加足迹异常")
=======
    USER_INFO_UPDATE_EXCEPTION(500,"修改用户信息异常"),

    ADD_ADDRESS_EXCEPTION(500,"新增地址异常"),
    delete_ADDRESS_EXCEPTION(500,"删除地址异常"),
>>>>>>> origin/master
    ;

    int code;
    String message;

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
